/* 优化后的样式 */
/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* 头部样式优化 */
.header {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    padding: 20px 15px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    backdrop-filter: blur(10px);
}

.header-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
}

.header-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.header-back {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    cursor: pointer;
    background: rgba(255,255,255,0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 主容器优化 */
.main-container {
    display: flex;
    min-height: calc(100vh - 160px);
    padding-bottom: 80px; /* 为底部按钮留出空间 */
}

/* 分类侧边栏优化 */
.category-sidebar {
    width: 120px;
    background: white;
    border-right: 1px solid #e8e8e8;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.category-list {
    padding: 10px 0;
}

.category-item {
    padding: 16px 12px;
    text-align: center;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.category-item.active {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    font-weight: bold;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.category-item:active {
    background: #ff5252;
}

/* 餐品区域优化 */
.product-area {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.category-toggle {
    padding: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 餐品网格优化 */
.product-grid {
    padding: 15px;
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.product-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.product-card:active::before {
    left: 100%;
}

.product-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.product-image {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    overflow: hidden;
    margin-right: 15px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-placeholder {
    font-size: 28px;
    color: white;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 6px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-description {
    font-size: 13px;
    color: #888;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-action {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.product-action:active {
    transform: scale(0.9);
}

/* 底部购物车优化 */
.cart-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.cart-info {
    flex: 1;
    min-width: 0;
}

.cart-count {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 4px;
    color: #333;
}

.cart-items {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.checkout-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

.checkout-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.cart-badge {
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* 购物车页面优化 */
.cart-container {
    padding-bottom: 100px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: white;
    margin: 0 10px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.cart-item-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #e8e8e8;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    transition: all 0.3s ease;
}

.quantity-btn:active {
    background: #f5f5f5;
    transform: scale(0.9);
}

.quantity {
    font-weight: bold;
    min-width: 36px;
    text-align: center;
    font-size: 16px;
    color: #333;
}

.remove-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.remove-btn:active {
    transform: scale(0.9);
}

/* 购物车底部操作栏优化 */
.checkout-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    gap: 12px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 1000;
}

.clear-cart-btn {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    flex: 1;
    transition: all 0.3s ease;
}

.clear-cart-btn:active {
    transform: scale(0.95);
}

.checkout-footer .checkout-btn {
    flex: 2;
    min-width: auto;
}

/* 订单处理页面优化 */
.process-container {
    padding: 20px 15px 100px;
}

.order-detail {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 17px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-item .label {
    font-weight: 500;
    color: #666;
    flex-shrink: 0;
    margin-right: 15px;
}

.detail-item .value {
    color: #333;
    text-align: right;
    flex: 1;
}

.order-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.order-detail-item:last-child {
    border-bottom: none;
}

.process-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.process-btn {
    padding: 16px 20px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    flex: 1;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.process-btn:active {
    transform: scale(0.95);
}

.complete-btn {
    background: linear-gradient(135deg, #52c41a, #73d13d);
    color: white;
}

.reject-btn {
    background: linear-gradient(135deg, #ff4d4f, #ff7875);
    color: white;
}

.process-note {
    margin-top: 20px;
}

/* 响应式优化 */
@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }
    
    .product-card {
        padding: 14px;
    }
    
    .product-image {
        width: 60px;
        height: 60px;
    }
    
    .checkout-footer {
        padding: 12px 15px;
    }
    
    .process-actions {
        flex-direction: column;
    }
}

/* 空状态优化 */
.empty-state, .empty-cart {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-text {
    font-size: 16px;
    margin-bottom: 25px;
}

.back-to-shop, .retry-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 25px;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.back-to-shop:active, .retry-btn:active {
    transform: scale(0.95);
}
/* Order页面专用样式 */
.order-container {
    padding: 20px 15px 100px;
}

.order-form {
    max-width: 100%;
}

.form-section {
    background: white;
    margin-bottom: 15px;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.section-title {
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 17px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 0;
}

.form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-input:focus {
    border-color: #ff6b6b;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: #fafafa;
    resize: none;
    font-family: inherit;
    min-height: 100px;
}

.form-textarea:focus {
    border-color: #ff6b6b;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* 订单项目样式 */
.order-items {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e8e8e8;
}

.order-item:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
    color: #333;
}

.item-quantity {
    color: #666;
    font-weight: bold;
}

/* 提交按钮样式 */
.submit-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    border-top: 1px solid #e8e8e8;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 1000;
}

.submit-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn.disabled {
    background: linear-gradient(135deg, #ccc, #bbb);
    cursor: not-allowed;
    box-shadow: none;
}

.submit-btn.disabled:active {
    transform: none;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 480px) {
    .order-container {
        padding: 15px 10px 90px;
    }
    
    .form-section {
        padding: 15px;
        margin-bottom: 12px;
    }
    
    .form-input, .form-textarea {
        padding: 12px;
    }
    
    .submit-footer {
        padding: 12px 15px;
    }
}
/* 产品图片样式优化 */
.product-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    margin-right: 15px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:active .product-image img {
    transform: scale(1.1);
}

.product-image-placeholder {
    font-size: 24px;
    color: #999;
}

/* 图片加载动画 */
.product-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}